#pragma once

#include "Math/Math.h"
#include "Triangle2D.h"


class WHENGINE_API CPolygon
{
public:    

    // InVertice, in clockwise
    CPolygon(TVector<SVertex2D> InVertice,TSharedObjectPtr<RMaterial> InMaterial);

    CPolygon(TVector<SVec2> InPosition,TVector<SVec2> InUV,TSharedObjectPtr<RMaterial> InMaterial);

    //clockwise 
    TVector<SVertex2D> Vertice;
    
    TSharedObjectPtr<RMaterial> Material;

    TVector<CTriangle2D> ToTriangles();


    static TVector<CTriangle2D> CreatePolygonTriangles(TVector<SVec2> InPosition,TVector<SVec2> InUV);
};